Repository navigation
fix(tools/uci): phase3_tcp_echo blocked by MemoryPolicy on its own uci_host_buf write (#97) - #105
Merged
Merged
Conversation
`phase3_tcp_echo.py` pre-seeds `uci_host_buf` over DMA so the hostname is
in place regardless of what `net_dns_resolve` copies. That write has no
`override=`, and `uci_host_buf` resolves to $6760 — UCI_BSS, which the
post-W1 UCI cfg packs *inside* CRYPTO_HOT ($6000-$9FFF). The harness
MemoryPolicy reserves CRYPTO_HOT as one coarse region and cannot tell a
writable BSS byte from resident code, so a legitimate write raises
MemoryPolicyError: write_memory($6760, 32 B) -> $677F blocked:
overlaps reserved region $6000-$9FFF (segment:CRYPTO_HOT)
and the script cannot complete on any device. Reported by an outside
contributor in #97, where it also blocked the diagnostic baseline run
they had been asked for.
Fix is an `override="<reason>"` at the call site, mirroring the `_OVR`
idiom already in `bench_ecdsa_u64e.py:186` — not a policy relaxation,
since the guard is doing its job everywhere else.
Audited the rest of the tree for the same latent break:
`grep -rn 'write_memory(labels' tools/` returns six sites, the other
five in `bench_ecdsa_u64e.py` and all already overridden. Every other
`write_memory` under `tools/uci/` targets an `arbiter.alloc()` address.
This was the only one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tools/uci/phase3_tcp_echo.pycannot complete on any device. It dies onits own DMA write, before reaching the TCP echo it exists to test:
Reported by an outside contributor in #97, where it also blocked the
diagnostic baseline run we had asked them for.
Cause
The script pre-seeds
uci_host_bufover DMA so the hostname is in placeregardless of what
net_dns_resolvecopies (deliberate belt-and-braces,per the comment there).
uci_host_bufis UCI_BSS, which the post-W1UCI cfg packs inside
CRYPTO_HOT— it resolves to$6760, verifiedagainst a local
make BACKEND=uci:tools/uci/_memory_policy.pyreservesCRYPTO_HOTas one coarse$6000-$9FFFregion and cannot tell a writable BSS byte from residentcode, so a legitimate write reads as a collision.
Fix
An
override="<reason>"at the call site, mirroring the_OVRidiomalready in
bench_ecdsa_u64e.py:186— which has exactly the samesituation for
ecdsa_*buffers insideCRYPTO_COLD_SHADOW. Not a policyrelaxation: the guard is doing its job everywhere else, and it is the
reason CRYPTO_OVERLAY collisions stopped being silent corruption.
Audit — this was the only one
Every other
write_memoryundertools/uci/*.pytargets anarbiter.alloc()address, so it is inside the harness scratch window byconstruction. Six label-address writes exist in the tree; five were
already overridden.
Refs #97.